package com.foo.Bussinesstest;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

import org.junit.Test;
import org.movieexample.ws.GetMovieByNameFaultException;
import org.movieexample.ws.MovieBusiness;
import org.sjsuglobalsearch.www.movieservice.GetAllMovieData;
import org.sjsuglobalsearch.www.movieservice.GetAllMovieDataResponse;
import org.sjsuglobalsearch.www.movieservice.GetMovieByGenre;
import org.sjsuglobalsearch.www.movieservice.GetMovieByGenreResponse;
import org.sjsuglobalsearch.www.movieservice.GetMovieByName;
import org.sjsuglobalsearch.www.movieservice.GetMovieByNameResponse;
import org.sjsuglobalsearch.www.movieservice.GetMovieByTheatre;
import org.sjsuglobalsearch.www.movieservice.GetMovieByTheatreResponse;
import org.sjsuglobalsearch.www.movieservice.GetMovieByTime;
import org.sjsuglobalsearch.www.movieservice.GetMovieByTimeResponse;
import org.sjsuglobalsearch.www.movieservice.GetMovieByType;
import org.sjsuglobalsearch.www.movieservice.GetMovieByTypeResponse;

public class MovieBussinessTest 
{
	@Test
	public void testGetAllMovieData() 
	{
		MovieBusiness bussiness = new MovieBusiness();
		GetAllMovieData getAllMovieData = new GetAllMovieData();
		getAllMovieData.setIn("");
		try 
		{
			GetAllMovieDataResponse allData =  bussiness.getAllMovieData(getAllMovieData);
			assertNotNull(allData);
		} 
		catch (Exception e) 
		{
			fail("Get All Movie Data testcase failed");
		}
	}
	
	@Test
	public void testGetMovieByName() throws GetMovieByNameFaultException
	{
		MovieBusiness bussiness = new MovieBusiness();
		GetMovieByName getMovieByName = new GetMovieByName();
		getMovieByName.setIn("Love");
		try 
		{
			System.out.println(" " + getMovieByName.getIn());
			GetMovieByNameResponse getbyname = bussiness.getMovieByName(getMovieByName);
			assertNotNull(getbyname);
		} 
		catch (Exception e) 
		{
			fail("Get Movie Data By Name testcase failed");
		}
	}
	@Test
	public void testGetMovieByGenre() 
	{
		MovieBusiness bussiness = new MovieBusiness();
		GetMovieByGenre getMovieByGenre = new GetMovieByGenre();
		getMovieByGenre.setIn("Comedy");
		try 
		{
			GetMovieByGenreResponse allData =  bussiness.getMovieByGenre(getMovieByGenre);
			assertNotNull(allData);
		} 
		catch (Exception e) 
		{
			fail("Get All Movie Data testcase failed");
		}
	}
	@Test
	public void testGetMovieByTime() 
	{
		MovieBusiness bussiness = new MovieBusiness();
		GetMovieByTime getMovieByTime = new GetMovieByTime();
		getMovieByTime.setIn("2:30pm");
		try 
		{
			GetMovieByTimeResponse allData =  bussiness.getMovieByTime(getMovieByTime);
			assertNotNull(allData);
		} 
		catch (Exception e) 
		{
			fail("Get All Movie Data testcase failed");
		}
	}
	
	@Test
	public void testGetMovieByTheatre() 
	{
		MovieBusiness bussiness = new MovieBusiness();
		GetMovieByTheatre getMovieBytheatre = new GetMovieByTheatre();
		getMovieBytheatre.setIn("");
		try 
		{
			GetMovieByTheatreResponse allData =  bussiness.getMovieByTheatre(getMovieBytheatre);
			assertNotNull(allData);
		} 
		catch (Exception e) 
		{
			fail("Get All Movie Data testcase failed");
		}
	}
	@Test
	public void testGetMovieByType() 
	{
		MovieBusiness bussiness = new MovieBusiness();
		GetMovieByType getMovieBytype = new GetMovieByType();
		getMovieBytype.setIn("");
		try 
		{
			GetMovieByTypeResponse allData =  bussiness.getMovieByType(getMovieBytype);
			assertNotNull(allData);
		} 
		catch (Exception e) 
		{
			fail("Get All Movie Data testcase failed");
		}
	}
}
